package org.sakai.controller;

import org.sakai.entity.ApiResponseEntity;
import org.sakai.entity.Result;
import org.sakai.entity.dto.AIChatRequest;
import org.sakai.service.AIChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/ai")
public class AIChatController {

    @Autowired
    private AIChatService aiChatService;

    @PostMapping("/chat")
    public ResponseEntity<String> chat(@RequestBody AIChatRequest request) {
        Result<String> result = aiChatService.chat(request);
        return ApiResponseEntity.getResponseEntity(result);
    }
} 